home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / QuickdrawText.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  5.4 KB  |  166 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        QuickdrawText.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __QUICKDRAWTEXT__
  13. #define __QUICKDRAWTEXT__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. #ifndef __INTLRESOURCES__
  20. #include <IntlResources.h>
  21. #endif
  22.  
  23.  
  24. enum{
  25. /* CharToPixel directions */
  26.  leftCaret = 0,                        /*Place caret for left block*/
  27.  rightCaret = -1,                    /*Place caret for right block*/
  28.  hilite = 1,                        /*Direction is SysDirection*/
  29.  
  30.  smLeftCaret = 0,                    /*Place caret for left block          obsolete */
  31.  smRightCaret = -1,                    /*Place caret for right block      obsolete */
  32.  smHilite = 1,                        /*Direction is TESysJust              obsolete */
  33.  
  34. /*Constants for styleRunPosition argument in PortionLine, DrawJustified,
  35.  MeasureJustified, CharToPixel, and PixelToChar.*/
  36.  onlyStyleRun = 0,                /* This is the only style run on the line */
  37.  leftStyleRun = 1,                /* This is leftmost of multiple style runs on the line */
  38.  rightStyleRun = 2,                /* This is rightmost of multiple style runs on the line */
  39.  middleStyleRun = 3,                /* There are multiple style runs on the line and this 
  40.  is neither the leftmost nor the rightmost. */
  41.  smOnlyStyleRun = 0,                /*      obsolete */
  42.  smLeftStyleRun = 1,                /*      obsolete */
  43.  smRightStyleRun = 2,            /*      obsolete */
  44.  smMiddleStyleRun = 3            /*      obsolete */
  45. };
  46.  
  47. /* type for styleRunPosition parameter in PixelToChar etc. */
  48. typedef short JustStyleCode;
  49.  
  50. struct FontInfo {
  51.  short ascent;
  52.  short descent;
  53.  short widMax;
  54.  short leading;
  55. };
  56.  
  57. typedef struct FontInfo FontInfo;
  58.  
  59. typedef short FormatOrder[1];
  60. typedef FormatOrder *FormatOrderPtr;
  61. typedef short FormatStatus;
  62.  
  63. #ifdef __cplusplus
  64. extern "C" {
  65. #endif
  66. pascal short Pixel2Char(Ptr textBuf,short textLen,short slop,short pixelWidth,
  67.  Boolean *leadingEdge)
  68.  = {0x2F3C,0x820E,0x0014,0xA8B5}; 
  69. pascal short Char2Pixel(Ptr textBuf,short textLen,short slop,short offset,
  70.  short direction)
  71.  = {0x2F3C,0x820C,0x0016,0xA8B5}; 
  72.  
  73. pascal short PixelToChar(Ptr textBuf,long textLen,Fixed slop,Fixed pixelWidth,
  74.  Boolean *leadingEdge,Fixed *widthRemaining,JustStyleCode styleRunPosition,
  75.  Point numer,Point denom)
  76.  = {0x2F3C,0x8222,0x002E,0xA8B5}; 
  77. pascal short NPixel2Char(Ptr textBuf,long textLen,Fixed slop,Fixed pixelWidth,
  78.  Boolean *leadingEdge,Fixed *widthRemaining,JustStyleCode styleRunPosition,
  79.  Point numer,Point denom)
  80.  = {0x2F3C,0x8222,0x002E,0xA8B5}; 
  81. pascal short CharToPixel(Ptr textBuf,long textLen,Fixed slop,long offset,
  82.  short direction,JustStyleCode styleRunPosition,Point numer,Point denom)
  83.  = {0x2F3C,0x821C,0x0030,0xA8B5}; 
  84. pascal short NChar2Pixel(Ptr textBuf,long textLen,Fixed slop,long offset,
  85.  short direction,JustStyleCode styleRunPosition,Point numer,Point denom)
  86.  = {0x2F3C,0x821C,0x0030,0xA8B5}; 
  87. pascal void DrawJustified(Ptr textPtr,long textLength,Fixed slop,JustStyleCode styleRunPosition,
  88.  Point numer,Point denom)
  89.  = {0x2F3C,0x8016,0x0032,0xA8B5}; 
  90. pascal void NDrawJust(Ptr textPtr,long textLength,Fixed slop,JustStyleCode styleRunPosition,
  91.  Point numer,Point denom)
  92.  = {0x2F3C,0x8016,0x0032,0xA8B5}; 
  93. pascal void MeasureJustified(Ptr textPtr,long textLength,Fixed slop,Ptr charLocs,
  94.  JustStyleCode styleRunPosition,Point numer,Point denom)
  95.  = {0x2F3C,0x801A,0x0034,0xA8B5}; 
  96. pascal void NMeasureJust(Ptr textPtr,long textLength,Fixed slop,Ptr charLocs,
  97.  JustStyleCode styleRunPosition,Point numer,Point denom)
  98.  = {0x2F3C,0x801A,0x0034,0xA8B5}; 
  99. pascal Fixed PortionLine(Ptr textPtr,long textLen,JustStyleCode styleRunPosition,
  100.  Point numer,Point denom)
  101.  = {0x2F3C,0x8412,0x0036,0xA8B5}; 
  102. pascal Fixed NPortionText(Ptr textPtr,long textLen,JustStyleCode styleRunPosition,
  103.  Point numer,Point denom)
  104.  = {0x2F3C,0x8412,0x0036,0xA8B5}; 
  105.  
  106. pascal void HiliteText(Ptr textPtr,short textLength,short firstOffset,short secondOffset,
  107.  OffsetTable offsets)
  108.  = {0x2F3C,0x800E,0x001C,0xA8B5}; 
  109. pascal void DrawJust(Ptr textPtr,short textLength,short slop)
  110.  = {0x2F3C,0x8008,0x001E,0xA8B5}; 
  111. pascal void MeasureJust(Ptr textPtr,short textLength,short slop,Ptr charLocs)
  112.  = {0x2F3C,0x800C,0x0020,0xA8B5}; 
  113.  
  114. pascal Fixed PortionText(Ptr textPtr,long textLen)
  115.  = {0x2F3C,0x8408,0x0024,0xA8B5}; 
  116. pascal long VisibleLength(Ptr textPtr,long textLen)
  117.  = {0x2F3C,0x8408,0x0028,0xA8B5}; 
  118. pascal void GetFormatOrder(FormatOrderPtr ordering,short firstFormat,short lastFormat,
  119.  Boolean lineRight,Ptr rlDirProc,Ptr dirParam)
  120.  = {0x2F3C,0x8012,0xFFFC,0xA8B5}; 
  121.  
  122.  
  123. pascal void TextFont(short font)
  124.  = 0xA887; 
  125. pascal void TextFace(short face)
  126.  = 0xA888; 
  127. pascal void TextMode(short mode)
  128.  = 0xA889; 
  129. pascal void TextSize(short size)
  130.  = 0xA88A; 
  131. pascal void SpaceExtra(Fixed extra)
  132.  = 0xA88E; 
  133. pascal void DrawChar(short ch)
  134.  = 0xA883; 
  135. pascal void DrawString(ConstStr255Param s)
  136.  = 0xA884; 
  137. pascal void DrawText(const void *textBuf,short firstByte,short byteCount)
  138.  = 0xA885; 
  139. pascal short CharWidth(short ch)
  140.  = 0xA88D; 
  141. pascal short StringWidth(ConstStr255Param s)
  142.  = 0xA88C; 
  143. pascal short TextWidth(const void *textBuf,short firstByte,short byteCount)
  144.  = 0xA886; 
  145. pascal void MeasureText(short count,const void *textAddr,void *charLocs)
  146.  = 0xA837; 
  147. pascal void GetFontInfo(FontInfo *info)
  148.  = 0xA88B; 
  149. pascal void CharExtra(Fixed extra)
  150.  = 0xAA23; 
  151.  
  152. pascal void StdText(short count,const void *textAddr,Point numer,Point denom)
  153.  = 0xA882; 
  154. void stdtext(short count,const void *textAddr,Point *numer,Point *denom); 
  155. pascal short StdTxMeas(short byteCount,const void *textAddr,Point *numer,
  156.  Point *denom,FontInfo *info)
  157.  = 0xA8ED; 
  158.  
  159.  
  160.  
  161. #ifdef __cplusplus
  162. }
  163. #endif
  164.  
  165. #endif
  166.